package com.ieslab.powergrid.demosvr.service;

import com.ieslab.powergrid.demosvr.entity.Person;
import com.ieslab.powergrid.demosvr.mapper.PersonMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;

/** <p>Title: PersonService </p>
 * <p>Description: 用户业务类，测试demo使用</p>
 *
 * @author houpeibin
 * @date 2020-2-20 下午7:15:30
 * @version V1.0
 */
@Service
public class PersonService{
    @Autowired
    PersonMapper personMapper;

    /**
     * 获取所有用户
     * @return
     */
    public List<Person> getPersons(Map map){
        return personMapper.getPersonByFilter(map);
    }

    /**
     * 插入用户
     * @param person 用户信息类
     * @return 插入几条数据
     */
    public int insertPersons(Person person){
        return personMapper.insert(person);
    }
}
